package com.dubbo.nacos;

import com.alibaba.dubbo.config.annotation.Reference;
import com.dubbo.nacos.service.DubboNacousDemoService;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author tc
 * @date 2018/12/22
 */
@SpringBootApplication(scanBasePackages = "com.dubbo.nacos")
@EnableAutoConfiguration(exclude = {DataSourceAutoConfiguration.class})
@RestController
public class CDubboSpringbootApplication {

    @Reference(version = "2.0.0")
    private DubboNacousDemoService nacousDemoService;

    @GetMapping("/say")
    public String say(@RequestParam String name) {
        return nacousDemoService.sayHello(name);
    }

    public static void main(String[] args) {
        SpringApplication.run(CDubboSpringbootApplication.class, args);
    }

}
